home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1998 June / SGI IRIX 6.5 Applications 1998 June.iso / dist / impr_base.idb / usr / lib / ps / psdit.pro.z / psdit.pro
Text File  |  1998-05-04  |  8KB  |  235 lines

  1. % Start of psdit.pro -- prolog for ditroff translator
  2. % Copyright (c) 1985,1987 Adobe Systems Incorporated. All Rights Reserved. 
  3. % GOVERNMENT END USERS: See Notice file in TranScript library directory
  4. % -- probably /usr/lib/ps/Notice
  5. % $Revision: 1.2 $
  6. /$DITroff 140 dict def $DITroff begin
  7. /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def
  8. /xi {0 72 11 mul translate 72 resolution div dup neg scale 0 0 moveto
  9.   /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def F
  10.   /pagesave save def}def
  11. /PB{save /psv exch def currentpoint translate
  12.   resolution 72 div dup neg scale 0 0 moveto}def
  13. /PE{psv restore}def
  14. /m1 matrix def /m2 matrix def /m3 matrix def /oldmat matrix def
  15. /tan{dup sin exch cos div}bind def
  16. /point{resolution 72 div mul}bind def
  17. /dround    {transform round exch round exch itransform}bind def
  18. /xT{/devname exch def}def
  19. /xr{/mh exch def /my exch def /resolution exch def}def
  20. /xp{}def
  21. /xs{docsave restore end}def
  22. /xt{}def
  23. /xf{/fontname exch def /slotno exch def fontnames slotno get fontname eq not
  24.  {fonts slotno fontname findfont put fontnames slotno fontname put}if}def
  25. /xH{/fontheight exch def F}bind def
  26. /xS{/fontslant exch def F}bind def
  27. /s{/fontsize exch def /fontheight fontsize def F}bind def
  28. /f{/fontnum exch def F}bind def
  29. /F{fontheight 0 le {/fontheight fontsize def}if
  30.    fonts fontnum get fontsize point 0 0 fontheight point neg 0 0 m1 astore
  31.    fontslant 0 ne{1 0 fontslant tan 1 0 0 m2 astore m3 concatmatrix}if
  32.    makefont setfont .04 fontsize point mul 0 dround pop setlinewidth}bind def
  33. /X{exch currentpoint exch pop moveto show}bind def
  34. /N{3 1 roll moveto show}bind def
  35. /Y{exch currentpoint pop exch moveto show}bind def
  36. /S /show load def
  37. /ditpush{}def/ditpop{}def
  38. /AX{3 -1 roll currentpoint exch pop moveto 0 exch ashow}bind def
  39. /AN{4 2 roll moveto 0 exch ashow}bind def
  40. /AY{3 -1 roll currentpoint pop exch moveto 0 exch ashow}bind def
  41. /AS{0 exch ashow}bind def
  42. /MX{currentpoint exch pop moveto}bind def
  43. /MY{currentpoint pop exch moveto}bind def
  44. /MXY /moveto load def
  45. /cb{pop}def    % action on unknown char -- nothing for now
  46. /n{}def/w{}def
  47. /p{pop showpage pagesave restore /pagesave save def}def
  48. /abspoint{currentpoint exch pop add exch currentpoint pop add exch}def
  49. /dstroke{currentpoint stroke moveto}bind def
  50. /Dl{2 copy gsave rlineto stroke grestore rmoveto}bind def
  51. /arcellipse{oldmat currentmatrix pop
  52.  currentpoint translate 1 diamv diamh div scale /rad diamh 2 div def
  53.  rad 0 rad -180 180 arc oldmat setmatrix}def
  54. /Dc{gsave dup /diamv exch def /diamh exch def arcellipse dstroke 
  55.     grestore diamh 0 rmoveto}def
  56. /De{gsave /diamv exch def /diamh exch def arcellipse dstroke
  57.     grestore diamh 0 rmoveto}def
  58. /Da{currentpoint /by exch def /bx exch def /fy exch def /fx exch def
  59.    /cy exch def /cx exch def /rad cx cx mul cy cy mul add sqrt def
  60.    /ang1 cy neg cx neg atan def /ang2 fy fx atan def cx bx add cy by add
  61.    2 copy rad ang1 ang2 arcn stroke exch fx add exch fy add moveto}def
  62. /Barray 200 array def % 200 values in a wiggle
  63. /D~{mark}def
  64. /D~~{counttomark Barray exch 0 exch getinterval astore /Bcontrol exch def pop
  65.  /Blen Bcontrol length def Blen 4 ge Blen 2 mod 0 eq and
  66.  {Bcontrol 0 get Bcontrol 1 get abspoint /Ycont exch def /Xcont exch def
  67.   Bcontrol 0 2 copy get 2 mul put Bcontrol 1 2 copy get 2 mul put
  68.   Bcontrol Blen 2 sub 2 copy get 2 mul put
  69.   Bcontrol Blen 1 sub 2 copy get 2 mul put
  70.   /Ybi /Xbi currentpoint 3 1 roll def def 0 2 Blen 4 sub
  71.   {/i exch def
  72.    Bcontrol i get 3 div Bcontrol i 1 add get 3 div
  73.    Bcontrol i get 3 mul Bcontrol i 2 add get add 6 div
  74.    Bcontrol i 1 add get 3 mul Bcontrol i 3 add get add 6 div
  75.    /Xbi Xcont Bcontrol i 2 add get 2 div add def
  76.    /Ybi Ycont Bcontrol i 3 add get 2 div add def
  77.    /Xcont Xcont Bcontrol i 2 add get add def
  78.    /Ycont Ycont Bcontrol i 3 add get add def
  79.    Xbi currentpoint pop sub Ybi currentpoint exch pop sub rcurveto
  80.   }for dstroke}if}def
  81. end
  82. /ditstart{$DITroff begin
  83.  /nfonts 60 def            % NFONTS makedev/ditroff dependent!
  84.  /fonts[nfonts{0}repeat]def
  85.  /fontnames[nfonts{()}repeat]def
  86. /docsave save def
  87. }def
  88.  
  89. % character outcalls
  90. /oc {/pswid exch def /cc exch def /name exch def
  91.    /ditwid pswid fontsize mul resolution mul 72000 div def
  92.    /ditsiz fontsize resolution mul 72 div def
  93.    ocprocs name known{ocprocs name get exec}{name cb}
  94.    ifelse}def
  95. /fractm [.65 0 0 .6 0 0] def
  96. /fraction
  97.  {/fden exch def /fnum exch def gsave /cf currentfont def
  98.   cf fractm makefont setfont 0 .3 dm 2 copy neg rmoveto
  99.   fnum show rmoveto currentfont cf setfont(\244)show setfont fden show 
  100.   grestore ditwid 0 rmoveto} def
  101. /oce {grestore ditwid 0 rmoveto}def
  102. /dm {ditsiz mul}def
  103. /ocprocs 50 dict def ocprocs begin
  104. (14){(1)(4)fraction}def
  105. (12){(1)(2)fraction}def
  106. (34){(3)(4)fraction}def
  107. (13){(1)(3)fraction}def
  108. (23){(2)(3)fraction}def
  109. (18){(1)(8)fraction}def
  110. (38){(3)(8)fraction}def
  111. (58){(5)(8)fraction}def
  112. (78){(7)(8)fraction}def
  113. (sr){gsave .05 dm .16 dm rmoveto(\326)show oce}def
  114. (is){gsave 0 .15 dm rmoveto(\362)show oce}def
  115. (->){gsave 0 .02 dm rmoveto(\256)show oce}def
  116. (<-){gsave 0 .02 dm rmoveto(\254)show oce}def
  117. (==){gsave 0 .05 dm rmoveto(\272)show oce}def
  118. end
  119. % DIThacks fonts for some special chars
  120. 50 dict dup begin
  121. /FontType 3 def
  122. /FontName /DIThacks def
  123. /FontMatrix [.001 0.0 0.0 .001 0.0 0.0] def
  124. /FontBBox [-220 -280 900 900] def% a lie but ...
  125. /Encoding 256 array def
  126. 0 1 255{Encoding exch /.notdef put}for
  127. Encoding
  128.  dup 8#040/space put %space
  129.  dup 8#110/rc put %right ceil
  130.  dup 8#111/lt put %left  top curl
  131.  dup 8#112/bv put %bold vert
  132.  dup 8#113/lk put %left  mid curl
  133.  dup 8#114/lb put %left  bot curl
  134.  dup 8#115/rt put %right top curl
  135.  dup 8#116/rk put %right mid curl
  136.  dup 8#117/rb put %right bot curl
  137.  dup 8#120/rf put %right floor
  138.  dup 8#121/lf put %left  floor
  139.  dup 8#122/lc put %left  ceil
  140.  dup 8#140/sq put %square
  141.  dup 8#141/bx put %box
  142.  dup 8#142/ci put %circle
  143.  dup 8#143/br put %box rule
  144.  dup 8#144/rn put %root extender
  145.  dup 8#145/vr put %vertical rule
  146.  dup 8#146/ob put %outline bullet
  147.  dup 8#147/bu put %bullet
  148.  dup 8#150/ru put %rule
  149.  dup 8#151/ul put %underline
  150.  pop
  151. /DITfd 100 dict def
  152. /BuildChar{0 begin
  153.  /cc exch def /fd exch def
  154.  /charname fd /Encoding get cc get def
  155.  /charwid fd /Metrics get charname get def
  156.  /charproc fd /CharProcs get charname get def
  157.  charwid 0 fd /FontBBox get aload pop setcachedevice
  158.  40 setlinewidth
  159.  newpath 0 0 moveto gsave charproc grestore
  160.  end}def
  161. /BuildChar load 0 DITfd put
  162. %/UniqueID 5 def
  163. /CharProcs 50 dict def
  164. CharProcs begin
  165. /space{}def
  166. /.notdef{}def
  167. /ru{500 0 rls}def
  168. /rn{0 750 moveto 500 0 rls}def
  169. /vr{20 800 moveto 0 -770 rls}def
  170. /bv{20 800 moveto 0 -1000 rls}def
  171. /br{20 770 moveto 0 -1040 rls}def
  172. /ul{0 -250 moveto 500 0 rls}def
  173. /ob{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath stroke}def
  174. /bu{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath fill}def
  175. /sq{80 0 rmoveto currentpoint dround newpath moveto
  176.     640 0 rlineto 0 640 rlineto -640 0 rlineto closepath stroke}def
  177. /bx{80 0 rmoveto currentpoint dround newpath moveto
  178.     640 0 rlineto 0 640 rlineto -640 0 rlineto closepath fill}def
  179. /ci{355 333 rmoveto currentpoint newpath 333 0 360 arc
  180.     50 setlinewidth stroke}def
  181.  
  182. /lt{20 -200 moveto 0 550 rlineto currx 800 2cx s4 add exch s4 a4p stroke}def
  183. /lb{20 800 moveto 0 -550 rlineto currx -200 2cx s4 add exch s4 a4p stroke}def
  184. /rt{20 -200 moveto 0 550 rlineto currx 800 2cx s4 sub exch s4 a4p stroke}def
  185. /rb{20 800 moveto 0 -500 rlineto currx -200 2cx s4 sub exch s4 a4p stroke}def
  186. /lk{20 800 moveto 20 300 -280 300 s4 arcto pop pop 1000 sub
  187.     currentpoint stroke moveto
  188.     20 300 4 2 roll s4 a4p 20 -200 lineto stroke}def
  189. /rk{20 800 moveto 20 300 320 300 s4 arcto pop pop 1000 sub
  190.     currentpoint stroke moveto
  191.     20 300 4 2 roll s4 a4p 20 -200 lineto stroke}def
  192. /lf{20 800 moveto 0 -1000 rlineto s4 0 rls}def
  193. /rf{20 800 moveto 0 -1000 rlineto s4 neg 0 rls}def
  194. /lc{20 -200 moveto 0 1000 rlineto s4 0 rls}def
  195. /rc{20 -200 moveto 0 1000 rlineto s4 neg 0 rls}def
  196. end
  197.  
  198. /Metrics 50 dict def Metrics begin
  199. /.notdef 0 def
  200. /space 500 def
  201. /ru 500 def
  202. /br 0 def
  203. /lt 250 def
  204. /lb 250 def
  205. /rt 250 def
  206. /rb 250 def
  207. /lk 250 def
  208. /rk 250 def
  209. /rc 250 def
  210. /lc 250 def
  211. /rf 250 def
  212. /lf 250 def
  213. /bv 250 def
  214. /ob 350 def
  215. /bu 350 def
  216. /ci 750 def
  217. /bx 750 def
  218. /sq 750 def
  219. /rn 500 def
  220. /ul 500 def
  221. /vr 0 def
  222. end
  223.  
  224. DITfd begin
  225. /s2 500 def /s4 250 def /s3 333 def
  226. /a4p{arcto pop pop pop pop}def
  227. /2cx{2 copy exch}def
  228. /rls{rlineto stroke}def
  229. /currx{currentpoint pop}def
  230. /dround{transform round exch round exch itransform} def
  231. end
  232. end
  233. /DIThacks exch definefont pop
  234.  
  235.